#ifndef MAP_H
#define MAP_H


/* Std stuff */
#include <iostream>
#include <cmath>

/* Qt's stuff */
#include <QDebug>
#include <QLinkedList>
#include <QDateTime>
#include <QPoint>
#include <QFile>
#include <QTextStream>

/* My files */
#include "mapfield.h"
#include "wall.h"
#include "exit.h"

enum MoveAction {NORTH=0, EAST=1, WEST=2, SOUTH=3};

class Map
{

public:
    Map(int size, int numberOfExits);
    ~Map();
    void showOnConsole();
    int getMapSize() const;
    QPoint generateRandomCoordinateOnMap();
    void drawExits();
    MapField& operator()(int x, int y);
    //MapField operator()(int x, int y) const;

private:
    MapField** _plane;

    const int _mapSize;
    const int _numberOfExits;


    QLinkedList<Exit> _exits;

    void buildWalls();
    void buildExits();
    void putWallOnMap(QLinkedList<QPoint> wall);
    bool validateWall(QLinkedList<QPoint> wall);



};

#endif // MAP_H
